<template>
  <div class="recommend">
    <div class="title border-bottom">
      <img src="http://img1.qunarzz.com/piao/fusion/1711/89/ebc329f16c55bb02.png" alt="">
      <span>猜你喜欢</span>
    </div>
    <ul class="list border-bottom">
      <router-link
        tag="li"
        class="item border-bottom"
        v-for="item in list"
        :key="item.id"
        :to="'/detail/' + item.id"
      >
        <div class="item-img">
          <img :src="item.imgUrl" alt="">
        </div>
        <div class="item-tag">随买随用</div>
        <div class="item-info">
          <div class="item-title">{{ item.title }}</div>
          <div class="item-commend">
            <span class="item-commend-star iconfont">&#xe6b0;&#xe6b0;&#xe6b0;&#xe6b0;&#xe6b0;</span>
            <span class="item-commend-num">2092条评论</span>
          </div>
          <div class="item-price">
            <span class="item-price-money">¥
              <em class="item-price-num">{{ item.price }}</em>
            </span>起
          </div>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style scoped lang="less">
  @import "~styles/varibles";
.recommend{
  margin-top: 0.2rem;
  background-color: #fff;
  .title{
    height: 0.94rem;
    line-height: 0.94rem;
    font-size: 0.32rem;
    img{
      width: 0.32rem;
      margin-top: -0.1rem;
      margin-left: 0.2rem;
    }
  }
  .list{
    padding-left: 0.24rem;
    .item{
      height: 2.4rem;
      padding: .2rem 0 .2rem 0;
      box-sizing: border-box;
      overflow: hidden;
      .item-img{
        float: left;
        width: 2rem;
        height: 2rem;
        img{
          width: 100%;
        }
      }
      .item-tag{
        position: absolute;
        background: url("https://img1.qunarzz.com/piao/fusion/1802/20/2ba6d10b17972e02.png") no-repeat;
        width: 1.02rem;
        height: 0.38rem;
        line-height: 0.38rem;
        background-size: 100%;
        font-size: 0.2rem;
        text-indent: 0.03rem;
        color: white;
      }
      .item-info{
        float: left;
        padding-left: 0.22rem;
        .item-title{
          margin-top: .26rem;
          height: 0.44rem;
          line-height: .44rem;
          font-size: 0.32rem;
        }
        .item-commend{
          margin-top: .14rem;
          .item-commend-star{
            color: #FFB436;
            &.iconfont{
              font-size: 0.24rem;
            }
          }
          .item-commend-num{
            color: @msgColor;
            margin-left: 0.15rem;
            font-size: 0.24rem;
          }
        }
        .item-price{
          margin-top: 0.3rem;
          color: @msgColor;
          .item-price-money{
            color: #ff8300;
            .item-price-num{
              font-size: 0.4rem;
            }
          }
        }
      }
    }
  }
}
</style>
